//
// Created by 86176 on 2021/11/3.
//

#ifndef CHENYUENEW_FILTERCHAIN_H
#define CHENYUENEW_FILTERCHAIN_H
//#include "FilterChain.h"
#include "Message.h"
#include "Session.h"

class FilterChain {
protected:

public:
    bool linkToHead;
    bool linkToTail;
    std::string chainName;
    FilterChain* lastChain;
    FilterChain* nextChain;

    explicit FilterChain(const std::string& str);

    void messageRecevide(FilterChain *filterChain,Session *session,Message *message);
    void messagePostvide(FilterChain *filterChain,Session *session,Message *message);
    void callNextMessageRecevide(Session* session,Message *message);
    void callLastMessagePostvide(Session* session,Message *message);
    //virtual void getMessage(Session* session,Message *message)=0;
    virtual bool getMessage(Session *pSession,IoBuffer* ioBuffer ,Message *pMessage)=0;
    virtual bool postMessage(Session *pSession,IoBuffer* ioBuffer ,Message *pMessage)=0;

};


#endif //CHENYUENEW_FILTERCHAIN_H
